package com.keyholesoftware.trango.apt;

import java.util.Map;

import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;

@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("com.keyholesoftware.trango.annotations.TrangoEntity")
public class TrangoEntityProcessor extends TrangoAnnotationProcessor {

	@Override
	protected Map<String, Object> buildContext(RoundEnvironment roundEnvironment, TypeElement annotationElement, TypeElement classElement) {
		Map<String, Object> context = super.buildContext(roundEnvironment, annotationElement, classElement);
		flattenAnnotationToContext(ENTITY_ANNOTATION, classElement, annotationElement, context);
		return context;
	}

	@Override
	protected String getTemplateName() {
		return "TrangoEntity.vm";
	}
}
